package Power_Adapter_07;

public class VoltageAdapter extends PowerSource220V implements Power5V {
    private PowerSource220V source;

    public VoltageAdapter(PowerSource220V source) {
        this.source = source;
    }


    private static final int TARGET_VOLTAGE = 5;

    public int output5V() {
        int voltage = output220V();
        System.out.println("适配器将" + voltage + "V转换为" + TARGET_VOLTAGE + "V");
        return TARGET_VOLTAGE;
    }
}
